import { Injectable } from '@nestjs/common';
import { Cron, CronExpression, Interval } from '@nestjs/schedule';
import IHelper from '@/services/helper.service';
import { ProxyFetchService } from '@/modules/proxy/proxy-fetch.service';
import axios from 'axios';
import { ConfigService } from '@nestjs/config';
import ILogger from '@/services/logger.service';


@Injectable()
export class ProxyScheduleService {
  constructor(
    private readonly configService: ConfigService,
  ) {
  }
  // @Cron("0 */2 * * * *")
  // @Interval(3 * 60 * 1000)
  // scheduleToRefreshSource() {
  //   ILogger.info(`ScheduleToRefreshSource at ${IHelper.timeFormatted()}`)
  //   axios.get(`http://127.0.0.1:${this.configService.get("PORT")}/refresh_source`).catch(e => e)
  // }

  // @Interval(45 * 1000)
  // scheduleToVerifyDb() {
  //   ILogger.info(`scheduleToVerifyDb at ${IHelper.timeFormatted()}`)
  //   axios.get(`http://127.0.0.1:${this.configService.get("PORT")}/verify_db`).catch(e => e)
  // }
}